package com.ruoyi.system.controller;

import com.ruoyi.common.annotation.AnonymousAccess;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.vo.Result;
import com.ruoyi.system.domain.ProductCategory;
import com.ruoyi.system.mapper.ProductCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
public class ProductCategoryController extends BaseController {

    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    /**
     * 查询商品分类列表
     */
    @GetMapping("/list")
    @AnonymousAccess
    public Result<List<ProductCategory>> list(ProductCategory productCategory) {
        List<ProductCategory> list = productCategoryMapper.selectProductCategoryList(productCategory);
        return Result.OK(list);
    }

}
